package com.y.fund.aacore.data;

import java.util.LinkedHashMap;

public class DataVo4Paging extends DataVo {


	/** Total number of records There is a value in the list data query interface, and other operation values are 0 */
    protected long totalSize;

    /** Record the current page number, the paging query interface has a value, and other operation values are 0 */
    protected long pageNum;

    /**  每页记录条数 */
    protected int pageSize;

	/** 列表数据的表头标题; 在data数据与表头分离时用到 */
    protected LinkedHashMap<String, String> titles;

	protected DataVo4Paging() {
		super();
        this.code = SUCCESSED;
    }

	public static DataVo4Paging Success(long totalSize, int PageSize, long pageNum, LinkedHashMap<String, String> titles){
		DataVo4Paging dv4p = new DataVo4Paging();
		dv4p.setTotalSize(totalSize);
		dv4p.setPageSize(PageSize);
		dv4p.setPageNum(pageNum);
		dv4p.setTitles(titles);
		return dv4p;
	}

	public static DataVo4Paging Success(long totalSize, int PageSize, long pageNum){
		DataVo4Paging dv4p = new DataVo4Paging();
		dv4p.setTotalSize(totalSize);
		dv4p.setPageSize(PageSize);
		dv4p.setPageNum(pageNum);
		return dv4p;
	}
	
	public DataVo4Paging(PaginationList data){
		super();
		this.setCode(SUCCESSED);
		this.setData(data);
		if(null != data) {
			this.setTotalSize(data.getTotalSize());
			this.setPageSize(data.getPageSize());
			this.setPageNum(data.getPageNum());
			this.setTitles(data.getTitles());
		}
	}

	public DataVo4Paging(int code, PaginationList data){
		super();
		this.setCode(code);
		this.setData(data);
		if(null != data) {
			this.setTotalSize(data.getTotalSize());
			this.setPageSize(data.getPageSize());
			this.setPageNum(data.getPageNum());
			this.setTitles(data.getTitles());
		}
	}
	
	public long getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(long totalSize) {
		this.totalSize = totalSize;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public void setPageNum(long pageNum) {
		this.pageNum = pageNum;
	}

	public long getPageNum() {
		return pageNum;
	}

	public LinkedHashMap<String, String> getTitles() {
		return titles;
	}

	public void setTitles(LinkedHashMap<String, String> titles) {
		this.titles = titles;
	}
	
}
